﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using MC.RideEventMVC.Models;

namespace MC.RideEventMVC.Controllers
{
    public class HomeController : Controller
    {
        private IEventRepository _repoEvent;

        public HomeController()
        {
            _repoEvent = new EventRepository();
        }

        public ActionResult Index()
        {
            ViewBag.Message = "Modify this template to jump-start your ASP.NET MVC application.";

            //Initialiser les variables de HomeViewModel
            HomeViewModel model = new HomeViewModel();
            model.ListEvents = _repoEvent.GetEvents();
            
            return View(model);
        }

        public ActionResult Events()
        {
            ViewBag.Message = "Your app description page of Event page.";

            return View();
        }

        public ActionResult Ways()
        {
            ViewBag.Message = "Your app description page of Ways page.";

            return View();
        }

        public ActionResult Contact()
        {
            ViewBag.Message = "Your contact page.";

            return View();
        }
    }
}
